<?php


namespace app\common\model;


use think\Model;
use think\Request;
use traits\model\SoftDelete;

class Gift extends Model
{
    use SoftDelete;
    // 表名
    protected $name = 'gift';
    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = 'deletetime';

    public function getImageAttr($value, $data)
    {
        $request = Request::instance();
        $domain=$request->domain();
        return $domain.$value;
    }
}